/**
 * uni-app请求封装
 */
export const uniRequest = (options) => {
  return new Promise((resolve, reject) => {
    uni.request({
      url: options.url,
      method: options.method || 'GET',
      data: options.method === 'GET' ? options.params : options.data,
      header: options.header,
      timeout: options.timeout || 30000,
      dataType: options.dataType || 'json',
      responseType: options.responseType || 'text',
      success: (res) => {
        resolve(res);
      },
      fail: (err) => {
        reject(err);
      }
    });
  });
}; 